package com.qj.daibei.controller;

import com.qj.daibei.pojo.Bank;
import com.qj.daibei.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * author wml
 * Created on 2021/10/4 21:32
 */
@Controller
public class BankController {

    @Autowired
    private BankService bankService;

    /**
     * 查询所有的银行
     * @Author wml
     * @return 返回一个 JSON 格式的银行集合
     */
    @GetMapping("/queryBank")
    public ResponseEntity<List<Bank>> queryBank() {
        List<Bank> bankList = this.bankService.queryBank();
        return new ResponseEntity<List<Bank>>(bankList, HttpStatus.OK);
    }
}
